package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.Brand;
import com.cskaoyan.bean.brand.vo.BrandListVo;
import com.cskaoyan.bean.brand.vo.WXBrandDetailVo;
import com.cskaoyan.bean.brand.vo.WXBrandListVo;
import com.cskaoyan.service.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wangdezhao
 * @date 2021/6/7
 * @description
 */
@RestController
@RequestMapping("wx/brand")
public class WXBrandController {
    @Autowired
    BrandService brandService;

    @RequestMapping("list")
    public BaseRespVo list(int page,int size){
        WXBrandListVo wxBrandList = brandService.getWXBrandList(page, size);
        return BaseRespVo.ok(wxBrandList);
    }

    @RequestMapping("detail")
    public BaseRespVo detail(Integer id){
        Brand wxBrandDetail = brandService.getWXBrandDetail(id);
        WXBrandDetailVo wxBrandDetailVo = new WXBrandDetailVo(wxBrandDetail);
        return BaseRespVo.ok(wxBrandDetailVo);
    }
}
